extends ../layout

append css
    link(rel='stylesheet', href='/components/font-awesome/css/font-awesome.css')
    link(rel='stylesheet', href='/css/admin.css')

block main

    nav.navbar.navbar-inverse.navbar-fixed-top
        .container-fluid
            .navbar-header
                button.navbar-toggle.collapsed(type="button", data-toggle="collapse", data-target="#navbar", aria-expanded="false", aria-controls="navbar")
                    span.sr-only Toggle navigation
                    span.icon-bar
                    span.icon-bar
                    span.icon-bar
                a.navbar-brand(href="/") NODE.JS 全栈博客系统
            #navbar.navbar-collapse.collapse
                ul.nav.navbar-nav.navbar-right
                    if user
                        li
                            a= user.email
                        li
                            a(href="/admin/users/logout")
                                i.fa.fa-unlock-alt
                                | &nbsp;注销
                    li
                        a(href="#")
                            i.fa.fa-question
                            | &nbsp;帮助

    .container-fluid
        .row
            .col-sm-3.col-md-2.sidebar
                ul.nav.nav-sidebar
                    li(class={active: pageName === "/admin/posts"})
                        a(href="/admin/posts")
                            i.fa.fa-files-o
                            | &nbsp;文章列表
                    li(class={active: pageName === "/admin/posts/add"})
                        a(href="/admin/posts/add")
                            i.fa.fa-file-o
                            | &nbsp;添加文章
                    li(class={active: pageName === "/admin/categories"})
                        a(href="/admin/categories")
                            i.fa.fa-th-list
                            | &nbsp;分类列表
                    li(class={active: pageName === "/admin/categories/add"})
                        a(href="/admin/categories/add")
                            i.fa.fa-plus
                            | &nbsp;添加分类

                ul.nav.nav-sidebar
                    li(class={active: pageName === "/admin/users/password"})
                        a(href="/admin/users/password")
                            i.fa.fa-lock
                            | &nbsp;修改密码

            .col-sm-9.col-sm-offset-3.col-md-10.col-md-offset-2.main
                != messages()
                block content
